TOOL_PREFIX = [TOOL_PREFIX]

TARGET = libcinvoke.a

all: $(TARGET)

clean:
	rm -f *.o arch/*.o libcinvoke.a

SRCS = cinvoke.c structure.c hashtable.c arch/[ARCH_SOURCE]

OBJS = $(SRCS:.c=.o)

$(TARGET): $(OBJS)
	[BUILDSTATIC] $(TARGET) $(OBJS)
	[RANLIB] $(TARGET)

.c.o:
	$(TOOL_PREFIX)gcc -save-temps [CFLAGS] -c $< -o $@

cinvoke.o: cinvoke.c cinvoke.h cinvoke-arch.h arch/[ARCH_HEADER] \
  cinvoke-private.h hashtable.h
structure.o: structure.c cinvoke.h cinvoke-arch.h arch/[ARCH_HEADER] \
  cinvoke-private.h hashtable.h
hashtable.o: hashtable.c hashtable.h
arch/[ARCH_OBJ]: arch/[ARCH_HEADER] arch/../cinvoke.h \
  arch/../cinvoke-arch.h \
  arch/../cinvoke-private.h arch/../hashtable.h
